package com.warningrc.util;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

public class LoggerUtils {
	public static final String LOG4J_CONFIG = "comfig/log4j/log4j.xml";
	private static final Logger logger = getLogger(LoggerUtils.class);
	static {
		String location = LoggerUtils.class.getResource(
				new StringBuilder("/").append(LOG4J_CONFIG).toString())
				.getFile();
		DOMConfigurator.configure(location);
		if (logger.isDebugEnabled())
			logger.debug("Log4j config file:" + location);
	}

	public static Logger getLogger(Class<?> clazz) {
		return Logger.getLogger(clazz);
	}

	public static void main(String[] args) {
		logger.info("test");
	}
}
